package behavioralPattern.iterator.example01;

import java.util.ArrayList;
import java.util.List;

public class Client_01 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();

        list.add("1");
        list.add("2");
        list.add("3");
        list.add("4");
        list.add("5");

        Iterator<String> iterator = new ConcreteIterator<>(list);

        while (iterator.hasNext()){
            System.out.println(iterator.currentItem());
            iterator.next();
        }
    }
}
